<?php


namespace app\admin\validate\member;


use think\Validate;

class MemberBusiness extends Validate
{


    protected $rule =   [

        'username'  => ['require',   'unique'=>'member_business'],
        'password'=>['require','length'=>'6,16'],
        // mobile和phone必须输入一个
        'user_id' => ['requireWithout'=>'token'],
        'token'  => ['requireWithout'=>'user_id'],
        'balance'=>['require'],
        'min_order'=>['require'],
        'max_order'=>['require'],
    ];

    protected $message  =   [

        'username.require'      => ['code' => 4012, 'msg' => '码商名称不能为空'],
        'username.unique'      => ['code' => 4013, 'msg' => '码商名称已经存在'],
        'password.require'   => ['code' => 4015, 'msg' => '密码不能为空'],
        // 'password.regex'   => ['code' => 4017, 'msg' => '密码规则不对'],
        'password.length'    => ['code' => 4016, 'msg' => '密码至少6-16位'],
        'email.require'      => ['code' => 4019, 'msg' => '邮箱必填'],
        'email.email'      => ['code' => 4019, 'msg' => '邮箱格式错误'],
        'phone.require'   => ['code' => 4015, 'msg' => '手机号码必填'],
    ];










}